<?php
namespace Home\Controller;

class IndustriesController extends HomeController {

    public function index(){
        $id = I('get.id');        
        $map['cid']=2;
        $list = M('Article')->field('id,title,content')->where($map)->select();
        $this->assign('list',$list);

        if ($id!='') {
            unset($map);
            $map['id']=$id;
            $content = M('Article')->where($map)->getField('content');
        }else{
            $content = $list[0]['content'];
        }
        $this->assign('content',$content);
        $this->assign('id',$id);
        $this->display();
    }    
}